#ifndef __ITASKPROVIDER_H__
#define __ITASKPROVIDER_H__

#include <QtPlugin>
#include <QVector>
#include "STask.h"

class ITaskProvider
{
public:
	/*!
		Opens connection to the provider
		\return true if connected
	*/
	virtual bool open() = 0;
	/*!
		Close connection to the provider
		\return true if closed
	*/
	virtual bool close() = 0;
	
	/*!
		Set a login string if needed by the provider
		\param login Login
	*/
	virtual void setLogin(QString login) = 0;
	/*!
		Set a password string if needed by the provider
		\param password Password
	*/
	virtual void setPassword(QString password) = 0;
	
	/*!
		Gets the provider name
		\return provider's name
	*/
	virtual QString providerName() = 0;
	
	/*!
		Gets full list of task
		\return All task from the provider
	*/
	virtual QVector<STask*> getTasks() = 0;
	/*!
		Adds a task
		\param task Task to add in the provider
		\return true if record
	*/
	virtual bool addTask(STask *task) = 0;
	/*!
		Modify a task
		\param task Task with modifications
		\return true if modification is done
	*/
	virtual bool setChange(STask *task) = 0;
	/*!
		Delete a task
		\param task Task to delete
		\return true if deleted
	*/
	virtual bool delTask(STask *task) = 0;
};

Q_DECLARE_INTERFACE(ITaskProvider, "org.toqo.toqo.ITaskProvider/1.0")

#endif //__ITASKPROVIDER_H__
